﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class video : System.Web.UI.Page
{
    public string video_url = "";
    public string video_name = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Write(System.Web.HttpContext.Current.Request.QueryString["id"]);
        string tid = System.Web.HttpContext.Current.Request.QueryString["id"];
        string sql = "";
        if (tid != null)
        {
            try
            {
                sql = "select id, mname, url from movielist where id = " + tid + "";
                string count_sql = "update movielist set playtimes = playtimes+ 1 where id = " + tid + "";
                DataSet list_ds = DBHelper.sqlMethod(sql);
                int result = DBHelper.sqlMethodNoDataset(count_sql);
               
                video_name = ">" + list_ds.Tables[0].Rows[0][1].ToString();
                video_url = list_ds.Tables[0].Rows[0][2].ToString();
            }
            catch (Exception err)
            {
                Response.Redirect("~/sort.aspx");
            }
        }
        else
        {
            Response.Redirect("~/sort.aspx");
        }



        
    }
}
